package com;

import com.utils.util;

import java.time.LocalDateTime;
import java.util.concurrent.TimeUnit;

public class test {
    public static void main(String[] args) {
        refreshSnsAccessToken();
    }

    private static  void refreshSnsAccessToken() {
        //根据时间轮每2个小时刷新一次wechatSnsAccessToken
        //当前时间
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime localDateTime = now.plusSeconds(10);
        util.getTimeWheel(localDateTime, new Runnable() {
            @Override
            public void run() {
                LocalDateTime now1 = LocalDateTime.now();
                String s = util.LocalDateTimeToString(now1);
                System.out.println("执行了: " + s);
                refreshSnsAccessToken();
            }
        });

    }
}
